#!/bin/sh -e

JAR=build/libs/app.jar
HEAP_SIZE=2g

[ -z ${JVM_OPTIONS} ] && JVM_OPTIONS="-server -Xms${HEAP_SIZE} -Xmx${HEAP_SIZE} --add-opens=java.base/java.time=ALL-UNNAMED --add-modules=jdk.incubator.vector"
[ -z ${SEED} ] && export SEED=${RANDOM}
[ -z ${SHADOW} ] && echo ./gradlew clean build shadowJar && ./gradlew clean build shadowJar

exec java ${JVM_OPTIONS} -jar ${JAR} $*
